package cn.lvji.springboot.learn3.controller;

import cn.lvji.springboot.learn3.vo.ScenicVO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 参数接收
 *
 * @author zhouzx
 */
@Controller
public class ParamController {

    @GetMapping("/scenice/get")
    @ResponseBody
    public String getScenic(Long id, String name) {
        return "scenic is (" + "id=" + id + ",name=" + name + ")";
    }

    @PostMapping("/scenic/form")
    @ResponseBody
    public String saveByFormdata(ScenicVO scenicVO) {
        return "success";
    }

    @PostMapping("/scenic/json")
    @ResponseBody
    public String saveByJson(@RequestBody ScenicVO scenicVO) {
        return "success";
    }

}
